﻿
<%@ Page Title="" Language="C#" MasterPageFile="~/CPSite.Master" AutoEventWireup="true" CodeBehind="Newslist.aspx.cs" Inherits="WebTemplate.ControlPanel.Newslist" MaintainScrollPositionOnPostback="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <asp:Label ID="Label1" Visible="false" runat="server" Text="delete"></asp:Label>
    <fieldset>
        <legend>Search
        </legend>

        <asp:Panel runat="server" CssClass="form">
            <p>
                <asp:Label runat="server" Text="Title" AssociatedControlID="txtTitle"></asp:Label>
                <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
            </p>
            <p>

                
                <asp:Label runat="server" Text="Date" AssociatedControlID="txtDate"></asp:Label>
                <asp:TextBox ID="txtDate" runat="server" TextMode="Date"></asp:TextBox>


            </p>
            <p>
                <asp:Label runat="server" Text="Editor" AssociatedControlID="txtEditor"></asp:Label>

                <asp:TextBox ID="txtEditor" runat="server"></asp:TextBox>
            </p>
            <p>
                <asp:Button runat="server" CommandName="SSearch" CssClass="formbutton" Text="Search" OnClick="btnSearch_Click" />
            </p>
        </asp:Panel>
    </fieldset>

    <asp:GridView ID="gvNewsResult" 
        OnPageIndexChanging="gvNewsResult_PageIndexChanging" OnSorting="gvNewsResult_Sorting"
        runat="server" AutoGenerateColumns="False" AllowSorting="true" PagerStyle-CssClass="pagger"
        DataKeyNames="Id" OnRowCommand="gvNewsResult_RowCommand" GridLines="None" AllowPaging="true" PageSize="5">
        <Columns >
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:BoundField DataField="ShortDescription" HeaderText="Short Description" SortExpression="ShortDescription" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" DataFormatString="{0:d}" />
            <asp:HyperLinkField Text="Edit" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/News/NewsDetails.aspx?id={0}" />
           <asp:TemplateField>
               <ItemTemplate>
                   <asp:LinkButton ID="LinkButton2" CommandArgument='<%# Container.DisplayIndex %>' CausesValidation="False" CommandName="DeleteItem" OnClientClick="return confirm(&quot;Do you want to delete this? &quot;);" runat="server">Delete</asp:LinkButton>
               </ItemTemplate>
           </asp:TemplateField>

            
        </Columns>
    </asp:GridView>
    </asp:Content>

